package com.ctsi.ssdc.admin.repository.oracle;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectKey;
import org.springframework.stereotype.Repository;

import com.ctsi.ssdc.admin.domain.CscpUserWorkGroup;
import com.ctsi.ssdc.admin.repository.CscpUserWorkGroupRepository;
import com.ctsi.ssdc.admin.repository.CscpUserWorkGroupSqlProvider;

/**
 * @author lym
*/

public interface CscpUserWorkGroupRepositoryForOracle extends CscpUserWorkGroupRepository{
    
    @Insert({
        "insert into cscp_user_work_group (id, user_id, group_id)",
        "values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{groupId,jdbcType=INTEGER})"
    })
    @SelectKey(statement="SELECT SEQ_CSCP_USER_WORK_GROUP_ID.nextval as id from dual", keyProperty="id", before=true, resultType=Integer.class)
    int insert(CscpUserWorkGroup record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_work_group
     *
     * @mbg.generated Sat Apr 28 14:39:47 CST 2018
     */
    @InsertProvider(type=CscpUserWorkGroupSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT SEQ_CSCP_USER_WORK_GROUP_ID.nextval as id from dual", keyProperty="id", before=true, resultType=Integer.class)
    int insertSelective(CscpUserWorkGroup record);
}